build: Dist the API references
authorEmmanuele Bassi <ebassi@gnome.org>
Tue, 30 Mar 2021 14:42:40 +0000 (15:42 +0100)
committerEmmanuele Bassi <ebassi@gnome.org>
Tue, 30 Mar 2021 14:42:40 +0000 (15:42 +0100)
Copy them into the dist root from the build root, so that they will be
available in the release archive.

build-aux/meson/dist-data.py [new file with mode: 0644]
build-aux/meson/dist-theme.py [deleted file]
meson.build

diff --git a/build-aux/meson/dist-data.py b/build-aux/meson/dist-data.py
new file mode 100644 (file)
index 0000000..da14c03
--- /dev/null
@@ -0,0 +1,39 @@
+#!/usr/bin/env python3
+
+import os
+import shutil
+import subprocess
+
+from pathlib import PurePath
+
+
+stylesheets = [
+    'gtk/theme/Adwaita/Adwaita.css',
+    'gtk/theme/Adwaita/Adwaita-dark.css',
+    'gtk/theme/HighContrast/HighContrast.css',
+    'gtk/theme/HighContrast/HighContrast-dark.css',
+]
+
+references = [
+    'docs/reference/gtk/gtk4',
+    'docs/reference/gsk/gsk4',
+    'docs/reference/gdk/gdk4',
+    'docs/reference/gdk/gdk4-wayland',
+    'docs/reference/gdk/gdk4-x11',
+]
+
+sourceroot = os.environ.get('MESON_SOURCE_ROOT')
+buildroot = os.environ.get('MESON_BUILD_ROOT')
+distroot = os.environ.get('MESON_DIST_ROOT')
+
+for stylesheet in stylesheets:
+    stylesheet_path = PurePath(stylesheet)
+    src = PurePath(sourceroot, stylesheet_path.with_suffix('.scss'))
+    dst = PurePath(distroot, stylesheet_path)
+    subprocess.call(['sassc', '-a', '-M', '-t', 'compact', src, dst])
+
+for reference in references:
+    src_path = os.path.join(buildroot, reference)
+    if os.path.isdir(src_path):
+        dst_path = os.path.join(distroot, reference)
+        shutil.copytree(src_path, dst_path)
diff --git a/build-aux/meson/dist-theme.py b/build-aux/meson/dist-theme.py
deleted file mode 100644 (file)
index b1d5291..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-#!/usr/bin/env python3
-
-import os
-from pathlib import PurePath
-import subprocess
-
-stylesheets = [ 'gtk/theme/Adwaita/Adwaita.css',
-                'gtk/theme/Adwaita/Adwaita-dark.css',
-                'gtk/theme/HighContrast/HighContrast.css',
-                'gtk/theme/HighContrast/HighContrast-dark.css' ]
-
-sourceroot = os.environ.get('MESON_SOURCE_ROOT')
-distroot = os.environ.get('MESON_DIST_ROOT')
-
-for stylesheet in stylesheets:
-  stylesheet_path = PurePath(stylesheet)
-  src = PurePath(sourceroot, stylesheet_path.with_suffix('.scss'))
-  dst = PurePath(distroot, stylesheet_path)
-  subprocess.call(['sassc', '-a', '-M', '-t', 'compact', src, dst])
index e25dec77c40855a5cb77df3e37708eac38e9d9ec..da84d5054b9db907b8217f3e8582d993d74d66b0 100644 (file)
@@ -818,7 +818,7 @@ else
 endif
 
 if not meson.is_subproject()
-    meson.add_dist_script('build-aux/meson/dist-theme.py')
+    meson.add_dist_script('build-aux/meson/dist-data.py')
 endif
 
 if host_machine.system() != 'windows'